
/*******************************************************************************************************

Figure 3: Event study coefficients

*******************************************************************************************************/

*Set director path
cd "C:\Users\tsa23\Documents\petitions\replication files"

clear all

*read in our main dataset
use dta\did_rep.dta


*Elminate contrituencies which are not part of case G
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if new == 1 | drummond == .


drop if year==1830 | year==1831 | year==1832

gen treatgroup = 0
replace treatgroup =  1 if new==1 

gen timevar1 = .
forvalues j= 0/5 {
replace timevar1 = 0+`j' if treatgroup==1 & year == 1833+`j'
}
forvalues k=0/9 {
replace timevar1 = -1-`k' if treatgroup==1 & year == 1829-`k'
}

set scheme plotplainblind
eventdd ln_petitions i.year, timevar(timevar1) method(fe) graph_op( yline(0, lcolor(black)) ///
xlabel(-10 "1820" -9 "1821" -8 "1822" -7 "1823" -6 "1824" -5 "1825" -4 "1826" -3 "1827" -2 "1828" -1 "1829" 0 "1833" 1 "1834" 2 "1835" 3 "1836" 4 "1837" 5 "1838", angle(90) ) ) 
graph export graphs\figure3a.pdf, as(pdf) name("Graph")  replace


clear all

*read in our main dataset
use dta\did_rep.dta


*Elminate contrituencies which are not part of case L
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if sch_A==1 | sch_B == 1 | drummond!=.

drop if year==1830 | year==1831 | year==1832

gen treatgroup = 0
replace treatgroup =  1 if sch_A==1 

gen timevar1 = .
forvalues j= 0/5 {
replace timevar1 = 0+`j' if treatgroup==1 & year == 1833+`j'
}
forvalues k=0/9 {
replace timevar1 = -1-`k' if treatgroup==1 & year == 1829-`k'
}

set scheme plotplainblind
eventdd ln_petitions i.year, timevar(timevar1) method(fe) graph_op( yline(0, lcolor(black)) ///
xlabel(-10 "1820" -9 "1821" -8 "1822" -7 "1823" -6 "1824" -5 "1825" -4 "1826" -3 "1827" -2 "1828" -1 "1829" 0 "1833" 1 "1834" 2 "1835" 3 "1836" 4 "1837" 5 "1838", angle(90) ) ) 
graph export graphs\figure3b.pdf, as(pdf) name("Graph")  replace


